package com.meeting.model.enums;

/**
 * 设备类型枚举
 */
public enum DeviceTypeEnum {
    PROJECTOR(1, "投影仪"),
    CONFERENCE_SYSTEM(2, "会议系统"),
    WHITEBOARD(3, "电子白板"),
    VIDEO_CONFERENCE(4, "视频会议终端"),
    NETWORK_EQUIPMENT(5, "网络设施"),
    SOUND_SYSTEM(6, "音响系统");

    private final int code;
    private final String description;

    DeviceTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static DeviceTypeEnum fromCode(int code) {
        for (DeviceTypeEnum type : values()) {
            if (type.code == code) {
                return type;
            }
        }
        throw new IllegalArgumentException("无效的设备类型码: " + code);
    }
}